package com.flyinzhen.customer.interfaces;

import com.flyinzhen.core.dto.ResponseDto;
import com.flyinzhen.customer.config.MultipartSupportConfig;
import com.flyinzhen.customer.service.FeignSupportServiceHystric;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 调用第三方远程微服务应用接口
 *
 * @author yinzhen
 * @date 2019-04-01
 */
@Component
@FeignClient(name = "spring-support", configuration = MultipartSupportConfig.class)
public interface IFeignSupportService {

    @PostMapping(value = "/file/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResponseDto uploadFile(@RequestParam String fileType, @RequestPart(value = "file") MultipartFile file);
}
